#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
using namespace std;
void test()
{
	//string s1("hello world");
	string s1("hello fast hello type hell hall");
	cout << s1 << endl;
	//s1.insert(2, "xxx");
	//s1.insert(0, 1, 'x');
	//s1.insert(s1.begin()+3, 'y');
	//s1.erase(5, 3);
	size_t pos = s1.find(' ');
	while (pos != string::npos)
	{
		s1.replace(pos, 1, "[");
		pos = s1.find(' ');
	}
	//s1.replace(2, 3, "MMM");
	cout << s1 << endl;
}
void test1()
{
	string s1("hello world hello fast hello lee");
	string s2;
	size_t pos = 0;
	while (pos < s1.size())
	{
		if (s1[pos] == ' ')
			s2 += "[]";
		else
			s2 += s1[pos];
		++pos;
	}
	//size_t pos = s1.find(' ');
	//s1.replace(pos, 1,"[]");
	s1.swap(s2);
	cout << s1 << endl;

}
void test2()
{
	string filename("test.cpp");
	FILE* fout = fopen(filename.c_str(), "r");
	char ch = fgetc(fout);
	while (ch != EOF)
	{
		cout << ch;
		ch = fgetc(fout);
	}
}
void test3()
{
	//string filename("test.cpp");
	//FILE* fout = fopen(filename.data(), "r");
	//char ch = fgetc(fout);
	//while (ch != EOF)
	//{
	//	cout << ch;
	//	ch = fgetc(fout);
	//}
	//string s2("test.cpp");
	//string s1("test.txt.tar");
	//size_t pos = s1.rfind('.');
	//string suff = s1.substr(pos, s1.size());
	//cout << suff << endl;
	//string s1("https://legacy.cplusplus.com/reference/string/basic_string/replace/");
	//size_t pos1 = s1.find(':');
	//string sub1, sub2, sub3;
	//sub1 = s1.substr(0, pos1);
	//size_t pos2 = s1.find('/',pos1+3);
	//sub2 = s1.substr(pos1 + 3, pos2 - pos1 - 3);
	//sub3 = s1.substr(pos2);
	//cout << sub1 << endl;
	//cout << sub2 << endl;
	//cout << sub3 << endl;
	//string s1("Please, replace the vowels in this sentence by asterisks.");
	//size_t found = s1.find_first_of("aeiou");
	//while (found != EOF)
	//{
	//	s1[found] = '*';
	//	found = s1.find_first_of("aeiou", found + 1);
	//}
	//cout << s1 << endl;
	string s1;
	getline(cin, s1);
	cout << s1 << endl;
}
int main()
{
	//test();
	test3();
	return 0;
}

